package com.yuexun.dhdoctor.module.departmentDocumentNew.model.impl;



import com.yuexun.dhdoctor.base.BaseEntity;
import com.yuexun.dhdoctor.module.departmentDocumentNew.api.ShareMemberApi;
import com.yuexun.dhdoctor.module.departmentDocumentNew.model.IShareMemberModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by wangt on 2017/7/21.
 */

public class ShareMemberModel implements IShareMemberModel {
    private ShareMemberApi api;

    public ShareMemberApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(ShareMemberApi.class);
        }
    }

    @Override
    public Observable<BaseEntity<String>> getMemberDatas(Map<String, String> praise) {
        api = ApiInstance();
        return api.getMemberDatas(praise);
    }

    @Override
    public Observable<BaseEntity<String>> setShareMember(Map<String, String> praise) {
        api = ApiInstance();
        return api.setShareMember(praise);
    }
}
